<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>用户基本信息</title>
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="format-detection" content="telephone=no">
        <link rel="stylesheet" href="__PUBLIC__/X-admin/css/x-admin.css" media="all">
    </head>
    <body>
        <div class="x-nav">
            <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新"><i class="layui-icon" style="line-height:29px">ဂ</i> <i class="layui-icon" style="line-height:30px">刷新</i></a>
        </div>
	

        <div class="x-body">
			<div class="layui-tab layui-tab-card">
			  <div class="layui-tab-content" style="height: 640px;">
			    <div class="layui-tab-item layui-show">
			    <!-- form  修改个人信息表单 -->
          <form class="layui-form" action="__MODULE__/User/update" method="post" >
			    <!-- <form class="layui-form" action="" method="post" > -->
			    	<input type="hidden" id="ids" name="id" value="{$list['id']}" >
			    	<table class="layui-table" lay-skin="nob">
					  <colgroup>
					    <col width="20%">
					    <col width="30%">
					    <col width="20%">
					    <col width="30%">
					  </colgroup>
					  <tbody>
					    <tr>
					      <td>性别</td>
					      <td>
					      	<div class="layui-form-item">
					            <input type="radio" name="sex" value="1" title="男" disabled <if condition="$list['sex'] eq 1"  >checked</if> >
					            <input type="radio" name="sex" value="0" title="女" disabled <if condition="$list['sex'] eq 0" >checked</if> >
					        </div>
					      </td>
					      <td>所在班级</td>
					      <td>{$list['class']}</td>
					    </tr>
					    <tr>
					      <td>所在小组</td>
					      <td>{$list['team']}</td>
					      <td>身份证号</td>
					      <td><input type="text" name="card" value="{$list['card']}" class="layui-input" disabled ></td>
					    </tr>
					    <tr>
					      <td>绩效分</td>
					      <td>{$list['performance']}分</td>
					      <td>籍贯</td>
					      <td><input type="text" name="address" value="{$list['address']}" class="layui-input" disabled ></td>
					    </tr>
					    <tr>
					      <td>手机号码</td>
					      <td><input type="text" name="phone" value="{$list['phone']}" class="layui-input" disabled ></td>
					      <td>QQ</td>
					      <td><input type="text" name="qq" value="{$list['qq']}" disabled class="layui-input"></td>
					    </tr>
					    <tr>
					      <td>邮箱</td>
					      <td><input type="text" name="email" value="{$list['email']}" disabled class="layui-input"></td>
					      <td>毕业院校</td>
					      <td><input type="text" name="school" value="{$list['school']}" disabled class="layui-input"></td>
					    </tr>
					    <tr>
					      <td>学校所在省</td>
					      <td><input type="text" name="school_address" disabled value="{$list['school_address']}" class="layui-input"></td>
					      <td>学历层次</td>
					      <td>
					      <select name="education" disabled >
								<option value="">--请选择--</option>
								<option value="初中" <if condition="$list['education'] eq '初中'" >selected</if> >初中</option>
								<option value="高中" <if condition="$list['education'] eq '高中'" >selected</if> >高中</option>
								<option value="中专" <if condition="$list['education'] eq '中专'" >selected</if> >中专</option>
								<option value="大专" <if condition="$list['education'] eq '大专'" >selected</if> >大专</option>
								<option value="本科" <if condition="$list['education'] eq '本科'" >selected</if> >本科</option>
								<option value="本科以上" <if condition="$list['education'] eq '本科以上'" >selected</if> >本科以上</option>
						  	</select>
					      </td>
					    </tr>
					    <tr>
					      <td>所修专业</td>
					      <td><input type="text" name="subject" value="{$list['subject']}" disabled class="layui-input"></td>
					      <td>计算机基础</td>
					      <td>
					      <select name="computer" disabled >
								<option value="">--请选择--</option>
								<option value="0" <if condition="$list['computer'] eq 0" >selected</if> >零基础</option>
								<option value="1" <if condition="$list['computer'] eq 1" >selected</if> >有一点点基础</option>
								<option value="2" <if condition="$list['computer'] eq 2" >selected</if> >计算机操作还可以</option>
								<option value="3" <if condition="$list['computer'] eq 3" >selected</if> >学过编程语言</option>
								<option value="4" <if condition="$list['computer'] eq 4" >selected</if> >有PHP编程基础</option>
								<option value="5" <if condition="$list['computer'] eq 5" >selected</if> >从事过PHP工作</option>
							</select>
					      </td>
					    </tr>
					    <tr>
					      <td>工作经验</td>
					      <td>
                  <select name="work_year" disabled>
                    <option value="">--请选择--</option>
                    <option value="0" <if condition="$list['work_year'] eq 0" >selected</if> >无</option>
                    <option value="1" <if condition="$list['work_year'] eq 1" >selected</if> >一年左右</option>
                    <option value="2" <if condition="$list['work_year'] eq 2" >selected</if> >一到两年</option>
                    <option value="3" <if condition="$list['work_year'] eq 3" >selected</if> >两到三年</option>
                    <option value="4" <if condition="$list['work_year'] eq 4" >selected</if> >三到五年</option>
                    <option value="5" <if condition="$list['work_year'] eq 5" >selected</if> >五年以上</option>
                  </select>
                </td>
					      <td>目标薪资</td>
					      <td><input type="text" name="target" value="{$list['target']}" disabled class="layui-input"></td>
					    </tr>
					    <tr>
					      <td>紧急联系人</td>
					      <td><input type="text" name="contacts_name" disabled value="{$list['contacts_name']}" class="layui-input"></td>
					      <td>与紧急联系人的关系</td>
					      <td><input type="text" name="contacts_relation" value="{$list['contacts_relation']}" disabled class="layui-input"></td>
					    </tr>
					    <tr>
					      <td>紧急联系人电话</td>
					      <td><input type="text" name="contacts_phone" value="{$list['contacts_phone']}" class="layui-input" disabled ></td>
					    </tr>
					    <tr>
					    	<td>
					    		<button class="layui-btn" lay-submit lay-filter="add" type="submit">修改</button>&nbsp;&nbsp;<span style="color:#9f9f9f;font-size:12px" >(*点击进行信息修改)</span>
					    	</td>
              </tr>
            </tbody>
          </table>
          </form>
                  
					
			    </div>
			  </div>
			</div>
           

        </div>
        <script src="__PUBLIC__/X-admin/lib/layui/layui.js" charset="utf-8"></script>
        <script src="__PUBLIC__/X-admin/js/x-layui.js" charset="utf-8"></script>

        <script>

            layui.use(['laydate','element','laypage','layer','form'], function(){
                $ = layui.jquery;//jquery
  				// var form = layui.form();
              laydate = layui.laydate;//日期插件
              lement = layui.element();//面包导航
              laypage = layui.laypage;//分页
              layer = layui.layer;//弹出层
              form = layui.form();
              

              //以上模块根据需要引入

              //监听提交按钮
              status=0;
              form.on('submit(add)', function(data){
                if (status == 0) {
                    $("input").removeAttr("disabled");
                    $("select").removeAttr("disabled");
                    $("button").html("提交");
                    status=1;
                     form.render();
                     // form.render('radio');
                     // form.render('checkbox');
                    return false;
                }else{
                    id = $("input[name='ids']").val();

                    sex = $("input[name='sex'").val();
                    card = $("input[name='card'").val();
                    address = $("input[name='address'").val();
                    phone = $("input[name='phone'").val();
                    qq = $("input[name='qq'").val();
                    email = $("input[name='email'").val();
                    school_address = $("input[name='school_address'").val();
                    school = $("input[name='school'").val();
                    education = $("input[name='education'").val();
                    subject = $("input[name='subject'").val();
                    computer = $("input[name='computer'").val();
                    work_year = $("input[name='work_year'").val();
                    target = $("input[name='target'").val();
                    contacts_name = $("input[name='contacts_name'").val();
                    contacts_relation = $("input[name='contacts_relation'").val();
                    contacts_phone = $("input[name='contacts_phone'").val();
                    // $.post('__MODULE__/User/insert',{id:id,sex:sex,card:card,address:address,phone:phone,qq:qq,email:email,school_address:school_address,school:school,education:education,subject:subject,computer:computer,work_year:work_year,target:target,contacts_name:contacts_name,contacts_relation:contacts_relation,contacts_phone:contacts_phone},function(data){
                    //     if(data=="修改成功"){
                    //         // alert("数据增加成功");
                    //     }else{
                    //         alert('修改失败');
                    //         return false;
                    //     }
                    // });
                    // layer.alert("添加成功", {icon: 6,name:2000},function () {
                    //     // 获得frame索引
                    //     var index = parent.layer.getFrameIndex(window.name);
                    //     //关闭当前frame
                    //     parent.layer.close(index);
                    //     parent.reload();
                    // });

                    $("input").addAttr("disabled");
                    $("button").html("修改");
                    status=0;
                    return true;
                }
               
            });

              form.on('switch(filter)', function(data){
                  if(data.elem.checked){
                      
                      $("form input").removeAttr("disabled");
                      
                      $("form select").removeAttr("disabled");
                      form.render();
                  }else{
                      $("form input").attr("disabled",true);
                      $("form select").attr("disabled",true);
                  }
              }); 


              laypage({
                cont: 'page'
                ,pages: 100
                ,first: 1
                ,last: 100
                ,prev: '<em><</em>'
                ,next: '<em>></em>'
              }); 
              
              var start = {
                min: laydate.now()
                ,max: '2099-06-16 23:59:59'
                ,istoday: false
                ,choose: function(datas){
                  end.min = datas; //开始日选好后，重置结束日的最小日期
                  end.start = datas //将结束日的初始值设定为开始日
                }
              };
              
              var end = {
                min: laydate.now()
                ,max: '2099-06-16 23:59:59'
                ,istoday: false
                ,choose: function(datas){
                  start.max = datas; //结束日选好后，重置开始日的最大日期
                }
              };
              
              document.getElementById('LAY_demorange_s').onclick = function(){
                start.elem = this;
                laydate(start);
              }
              document.getElementById('LAY_demorange_e').onclick = function(){
                end.elem = this
                laydate(end);
              }
              
            });

            //批量删除提交
             function delAll () {
                layer.confirm('确认要删除吗？',function(index){
                    //捉到所有被选中的，发异步进行删除
                    layer.msg('删除成功', {icon: 1});
                });
             }
             /*添加*/
            function admin_add(title,url,w,h){
                x_admin_show(title,url,w,h);
            }

             /*停用*/
            function admin_stop(obj,id){
                layer.confirm('确认要停用吗？',function(index){
                    //发异步把用户状态进行更改
                    $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="admin_start(this,id)" href="javascript:;" title="启用"><i class="layui-icon">&#xe62f;</i></a>');
                    $(obj).parents("tr").find(".td-status").html('<span class="layui-btn layui-btn-disabled layui-btn-mini">已停用</span>');
                    $(obj).remove();
                    layer.msg('已停用!',{icon: 5,time:1000});
                });
            }

            /*启用*/
            function admin_start(obj,id){
                layer.confirm('确认要启用吗？',function(index){
                    //发异步把用户状态进行更改
                    $(obj).parents("tr").find(".td-manage").prepend('<a style="text-decoration:none" onClick="admin_stop(this,id)" href="javascript:;" title="停用"><i class="layui-icon">&#xe601;</i></a>');
                    $(obj).parents("tr").find(".td-status").html('<span class="layui-btn layui-btn-normal layui-btn-mini">已启用</span>');
                    $(obj).remove();
                    layer.msg('已启用!',{icon: 6,time:1000});
                });
            }
            //编辑
            function admin_edit (title,url,id,w,h) {
                x_admin_show(title,url,w,h); 
            }
            /*删除*/
            function admin_del(obj,id){
                layer.confirm('确认要删除吗？',function(index){
                    //发异步删除数据
                    $(obj).parents("tr").remove();
                    layer.msg('已删除!',{icon:1,time:1000});
                });
            }
            </script>
            <script>
        var _hmt = _hmt || [];
        (function() {
          var hm = document.createElement("script");
          hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
          var s = document.getElementsByTagName("script")[0]; 
          s.parentNode.insertBefore(hm, s);
        })();
        </script>
    </body>
</html>